import { Meta, Story, Props, Canvas } from '@storybook/addon-docs/blocks'
import { config, withDesign } from 'storybook-addon-designs'
import { action } from '@storybook/addon-actions'

import BadgeCounter from '@baserow/modules/core/components/BadgeCounter'

<Meta
    title="Baserow/Badges"
    component={BadgeCounter}
    parameters={{
        backgrounds: {
            default: 'white',
            values: [
                { name: 'white', value: '#ffffff' },
                { name: 'light', value: '#eeeeee' },
                { name: 'dark', value: '#222222' },
            ],
        },
    }}
    decorators={[withDesign]}
    argTypes={{
        count: {
            control: {
                type: 'range',
                min: 0,
                max: 20,
            },
            defaultValue: 10,
        },
        limit: {
            control: {
                type: 'range',
                min: 0,
                max: 20,
            },
            defaultValue: 10,
        },
    }}
/>

# Badge Counter

export const Template = (args, { argTypes }) => ({
    components: { BadgeCounter },
    props: Object.keys(argTypes),
    template: `<BadgeCounter v-bind="$props"></BadgeCounter>`,
})

export const designConfig = {
    type: 'figma',
    url: 'https://www.figma.com/file/W7R2rQW7ohsZMeHRfEcPFW/Design-Library?node-id=53%3A21&mode=dev',
}

<Canvas>
    <Story
        name="Counter"
        args={{ count: 11, limit: 10 }}
        parameters={{
            design: config(designConfig),
        }}
    >
        {Template.bind({})}
    </Story>
</Canvas>

## Example

```javascript
<BadgeCounter count="15" limit="10"></BadgeCounter>
```

## Props

<Props of={BadgeCounter} />
